using UnityEngine;

namespace Scanline.GUI
{
    [SelectionBase]
    public class Pixel : MonoBehaviour
    {
        private SpriteRenderer spriteRenderer;
        [SerializeField]
        private Color color_internal;
        [SerializeField]
        private Color color_external;

        private bool isInternal;

        public bool IsInternal
        {
            get => isInternal;
            set
            {
                if (value != isInternal)
                {
                    isInternal = value;
                    spriteRenderer.color = value ? color_internal : color_external;
                }
            }
        }


        private void Awake()
        {
            spriteRenderer = GetComponent<SpriteRenderer>();
        }
    }
}